<?php
/**
 * Created by PhpStorm.
 * User: fengzi
 * Date: 2019/6/3
 * Time: 14:29
 */

namespace app\vehicle\model;
use think\Model;

class BusSkd extends Model
{
    public function getUpdateTimeAttr($value){
        return getTimeInfo($value);
    }
    public function bus(){
        return $this->hasOne('bus','id','bus_id')->with(['bus_business','brand']);
    }

    public function start(){
        return $this->hasOne('city','id','begin_city')->bind([
            's_city'=>'name'
        ]);
    }

    public function end(){
        return $this->hasOne('city','id','end_city')->bind([
            'e_city'=>'name'
        ]);
    }
}